import java.util.Scanner;

public class Test {
    public static void Code() {
        int count = 3; //问题在于如何对两个字符串进行比较？
        Scanner scanner = new Scanner(System.in);
        while(count != 0){
            System.out.println("请输入你的密码：");
            String  passWord = scanner.nextLine();
            if(passWord.equals("123456")){//调用string类下的equals方法
                System.out.println("登陆成功");
                break;
            }else {
                count--;
                System.out.println("你还有"+count+"次机会");
            }
        }
    }

    public static void main(String[] args) {
        Code();
    }
  /*  public static void Method(int a) {//该方法从个位依次输出某个整型变量的每一位数
        int b = 0;
        while(a!=0){
             b = a % 10;
            System.out.println(b);
            a = a/10;
        }
    }*/

   /* public static void main2(String[] args) {
        Method(123);

    }
    public static double abc(int n) {//该方法计算1/1-1/2+1/3......+1/99-1/100的值
        double b = 0;
       for(double a=1;a<=n;a++){
           b += Math.pow(-1,a+1)*(1/a);
       }
       return b;
    }

    public static void main1(String[] args) {
        double c = abc(100);
        System.out.println(c);
    }*/
}
